import os
import sys
import threading
import time

def thisScriptDirectory():
    return os.path.dirname(os.path.abspath(sys.argv[0]))

class SystemEnvironment:
    def __init__(self):
        if os.path.exists("/usr/bin/kdesu"):
            self.sudoGui = "/usr/bin/kdesu"
        elif os.path.exists("/usr/bin/gksudo"):
            self.sudoGui = "/usr/bin/gksudo"
        else:
            raise Exception, _("Cannot find kdesu or gksudo, please install one of them.")
    def getSudoGuiPath(self):
        return self.sudoGui
